/**
 * xdemo.org
 */
package org.xdemo.site.biz.portal.profile.bean;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

/**
 * @作者 Goofy
 * @邮件 252878950@qq.com
 * @日期 2013-12-31
 * @描述 账户实体类
 */
@Entity
@Table(name="account")
public class Account {
	
	@Id
	@GenericGenerator(name="idGenerator",strategy="uuid")//ID生成器属性包括生成器ID，生成策略
	@GeneratedValue(generator="idGenerator")//引用ID生成器
	@Column(length=64)
	private String accountId;
	/**
	 * 邮件地址,MYSQL最大的索引长度是255
	 */
	@Column(nullable=false,length=255,unique=true)
	private String mailAddress;
	/**
	 * 密码
	 */
	@Column(nullable=false,length=128)
	private String password;
	/**
	 * 与AccountExt一对一的关系,级联所有操作
	 */
	@OneToOne(fetch=FetchType.LAZY,cascade=CascadeType.ALL)
	@JoinColumn(name="accountExtId")
	private AccountExt accountExt;
	
	
	
	
	public String getAccountId() {
		return accountId;
	}
	public void setAccountId(String accountId) {
		this.accountId = accountId;
	}
	public String getMailAddress() {
		return mailAddress;
	}
	public void setMailAddress(String mailAddress) {
		this.mailAddress = mailAddress;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public AccountExt getAccountExt() {
		return accountExt;
	}
	public void setAccountExt(AccountExt accountExt) {
		this.accountExt = accountExt;
	}
	
	

}
